package top.hcode.hoj.pojo.entity.course;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @author orangej
 * @since 2024/12/17
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "课", description = "表示一节课，一般为一个讲课视频")
public class Lesson implements Serializable {

    private static final long serialVersionUID = 3901385586569803845L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "课程id")
    private Long courseId;

    @ApiModelProperty(value = "章节id")
    private Long sectionId;

    @ApiModelProperty(value = "课时名称")
    private String lessonName;

    @ApiModelProperty(value = "课时描述")
    private String description;

    @ApiModelProperty(value = "排序，由小到大")
    private Integer sortOrder;

    @ApiModelProperty(value = "视频地址")
    private String videoUrl;

    @ApiModelProperty(value = "课时时长（单位秒）")
    private Integer duration;

    @ApiModelProperty(value = "是否启用")
    private Boolean enabled = true;

    @ApiModelProperty(value = "资料数量")
    private Integer handoutCount = 0;

    @ApiModelProperty(value = "课堂作业数量")
    private Integer lessonWorkCount = 0;

    @ApiModelProperty(value = "课后作业数量")
    private Integer homeWorkCount = 0;

    @ApiModelProperty(value = "用户id")
    private String uid;

    @ApiModelProperty(value = "团队id")
    private Long gid;

    @TableField(fill = FieldFill.INSERT)
    private Date gmtCreate;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date gmtModified;

    /*关联字段*/

    @TableField(exist = false)
    private Course course;

    @TableField(exist = false)
    private CourseSection section;

    @TableField(exist = false)
    private List<LessonHandout> handoutList; // 资料列表<LessonHandout>
}



